feat(cli): add read-only /mcp status command - #876
feat(cli): add read-only /mcp status command#876fortissolucoescontato-bit wants to merge 3 commits into
Conversation
…th sanitization, and expanded credential redaction - Switch /mcp from defineCommand to defineCommandWithArgs for subcommand parsing - Add /mcp unknown subcommand handling that shows inline help with usage - Add /mcp list to help banner (Tips section) - Implement proper cross-platform sanitizePath replacing home dir with ~ - Add URL credentials, Basic auth, github_pat_, access_token, refresh_token, client_secret, passwd, and Authorization header sanitization patterns - Remove unused hashMcpConfig and getConnectedMCPClientKeys exports - Add parser integration tests, path sanitization tests, lifecycle tests, and expanded sanitization pattern tests - Improve JSDoc for McpClientConnectionInfo and getMCPClientConnectionInfo
|
Nice feature — a read-only A few things worth fixing before porting:
None of these block review — the core design (read-only, no side effects, sanitized output) is sound and matches what a maintainer would want to see before adding write commands ( |
Summary
Adds a read-only
/mcpcommand for inspecting configured MCP servers and the current runtime connection state.The implementation reuses the existing MCP configuration loader and runtime state. It does not introduce a second MCP client, modify MCP configuration files, or initiate connections when rendering the status.
Commands
/mcp/mcp listUnknown subcommands display inline usage information.
Output
The command displays:
When no servers are configured, it provides a short example using the existing
.agents/mcp.jsonformat.Security
.agents/mcp.json;~;Implementation
common;/mcpcommand handler and formatter incli;/mcpin the command registry and slash-command autocomplete;/mcpin the public README.Verification
bun run ci): PASS;git diff --check: PASS.Scope
This PR intentionally does not implement:
/mcp add;/mcp remove;/mcp reload;/mcp inspect.Those can be considered separately after the read-only status command is reviewed.